using System;
using Microsoft.SPOT;
using System.IO.Ports;
using System.Text;
using System.Net;
using System.Net.Sockets;

namespace Komodex.NETMF.MicroTweet.SerialConsole
{
    public static class Utility
    {
        #region SerialPort Extension Methods

        public static void Write(this SerialPort serialPort, string s)
        {
            byte[] buf = Encoding.UTF8.GetBytes(s);
            serialPort.Write(buf, 0, buf.Length);
        }

        public static void WriteLine(this SerialPort serialPort)
        {
            serialPort.Write("\r\n");
        }

        public static void WriteLine(this SerialPort serialPort, string s)
        {
            serialPort.Write(s + "\r\n");
        }

        #endregion
    }
}
